package com.thekernel.youdaoyun.bean;

import io.swagger.annotations.ApiModel;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author TheKernel
 * @Date 2019/9/14 10:58 上午
 * @Version 1.0
 * @Description 对应数据库中的 note 表
 */
@ApiModel(description = "note")
public class Note implements Serializable, Comparable<Note> {

    private static final long serialVersionUID = 6222176558369919438L;

    private long noteId;
    private String noteTitle;
    private String noteContent;
    private String noteSecret;
    private int category;
    private int type;
    private long noteUser;
    private Boolean folder;
    private Boolean status;
    private Date updateTime;
    private Date createTime;
    private int z;

    public long getNoteId() {
        return noteId;
    }

    public void setNoteId(long noteId) {
        this.noteId = noteId;
    }

    public String getNoteTitle() {
        return noteTitle;
    }

    public void setNoteTitle(String noteTitle) {
        this.noteTitle = noteTitle;
    }

    public String getNoteContent() {
        return noteContent;
    }

    public void setNoteContent(String noteContent) {
        this.noteContent = noteContent;
    }

    public String getNoteSecret() {
        return noteSecret;
    }

    public void setNoteSecret(String noteSecret) {
        this.noteSecret = noteSecret;
    }

    public int getCategory() {
        return category;
    }

    public void setCategory(int category) {
        this.category = category;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getZ() {
        return z;
    }

    public void setZ(int z) {
        this.z = z;
    }

    public long getNoteUser() {
        return noteUser;
    }

    public void setNoteUser(long noteUser) {
        this.noteUser = noteUser;
    }

    public Boolean getFolder() {
        return folder;
    }

    public void setFolder(Boolean folder) {
        this.folder = folder;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Note{" +
                "noteId=" + noteId +
                ", noteTitle='" + noteTitle + '\'' +
                ", noteContent='" + noteContent + '\'' +
                ", category=" + category +
                ", noteUser=" + noteUser +
                ", status=" + status +
                ", createTime=" + createTime +
                '}';
    }

    @Override
    public int compareTo(Note o) {
        if (this.getZ() == o.getZ()) {
            return o.getCreateTime().compareTo(this.getCreateTime());
        } else {
            return -Integer.compare(this.getZ(), o.getZ());
        }
    }
}
